package com.qinglei.recoup.longconn.enums;

import java.util.Arrays;

/**
 * 协议版本枚举
 *
 * @author yujunwei
 * @datetime 2022-03-03 14:52
 */
public enum ProtocolVersionEnum {

    DEFAULT("", "默认版本", "default"),
    V4("V4:protocol", "V4版本", "V4"),
    V7("V7:PROTO", "V7版本", "V7");

    private ProtocolVersionEnum(String key, String name, String version) {
        this.key = key;
        this.name = name;
        this.version = version;
    }

    private String key;

    private String name;

    private String version;

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public static void main(String[] args) {
        Arrays.asList(ProtocolVersionEnum.values()).stream().forEach(protocolVersion -> {
            System.out.println(protocolVersion.getVersion());
        });
        Arrays.asList(ProtocolVersionEnum.values()).stream().filter(protocolVersion -> !"".equals(protocolVersion.getKey())).forEach(protocolVersion -> {
            System.out.println(protocolVersion.getKey());
        });
    }
}
